package com.shangguan.atcrowdfunding.manager.controller;

import com.shangguan.atcrowdfunding.bean.Users;
import com.shangguan.atcrowdfunding.manager.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @ClassName: UsersController
 * @Description: 用户的控制层
 * @Author: 一尘
 * @Date: 2020 年 01 月 13 22:00
 * @Version 1.0
 */
@Controller
@RequestMapping("/users")
public class UsersController {
    @Autowired
    UsersService usersService;

    @RequestMapping("/list")
    public String findAllUsers(Model model){
     List<Users> usersList =    usersService.findAllUsers();
     model.addAttribute("usersList",usersList);
     return "UsersList";
    }
}
